﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;

using System.ComponentModel;

namespace AnOtherBlog.AJAX.Controls.MRPP
{
	public partial class Login : System.Web.UI.UserControl
	{
		protected void Page_Load(object sender, EventArgs e)
		{


			if (!IsPostBack)
			{
				Login1.CreateUserUrl = this.CreateUserUrl;
				if (string.IsNullOrEmpty(Login1.CreateUserUrl))
				{
					Login1.CreateUserText = "";
				}
				Login1.PasswordRecoveryUrl = this.PasswordRecoveryUrl;
				if (string.IsNullOrEmpty(Login1.PasswordRecoveryUrl))
				{
					Login1.PasswordRecoveryText = "";
				}

				((TextBox)Login1.FindControl("UserName")).Focus();
			}
		}

		#region Fields and Properties

		/// <summary>
		/// Keeps Page Url to create a new account 
		/// </summary>
		private string createUserUrl;
		[Category("Links")]
		[DefaultValue("")]
		public string CreateUserUrl
		{
			get
			{
				if (this.EnableViewState)
				{
					object tmp = ViewState["createUserUrl"];
					createUserUrl = (tmp == null) ? "" : (string)tmp;
				}
				return createUserUrl;
			}
			set
			{
				createUserUrl = value;
				if (this.EnableViewState)
				{
					ViewState["createUserUrl"] = createUserUrl;
				}
			}
		}
		/// <summary>
		/// Keeps Page Url to recover password utility
		/// </summary>
		private string passwordRecoveryUrl;
		[Category("Links")]
		[DefaultValue("")]
		public string PasswordRecoveryUrl
		{
			get
			{
				if (this.EnableViewState)
				{
					object tmp = ViewState["passwordRecoveryUrl"];
					passwordRecoveryUrl = (tmp == null) ? "" : (string)tmp;
				}
				return passwordRecoveryUrl;
			}
			set
			{
				passwordRecoveryUrl = value;
				if (this.EnableViewState)
				{
					ViewState["passwordRecoveryUrl"] = passwordRecoveryUrl;
				}
			}
		}

		#endregion
	}
}